Type-safe cast
نویسنده
چکیده
In a language with non-parametric or ad-hoc polymorphism, it is possible to determine the identity of a type variable at run time. With this facility, we can write a function to convert a term from one abstract type to another, if the two hidden types are identical. However, the naive implementation of this function requires that the term be destructed and rebuilt. In this paper, we show how to eliminate this overhead using higher-order type abstraction. We demonstrate this solution in two frameworks for ad-hoc polymorphism: intensional type analysis and type classes.
منابع مشابه
Type-safe cast does no harm Theoretical Pearl
Generic functions can specialize their behaviour depending on the types of their arguments, and can even recurse over the structure of the types of their arguments. Such functions can be programmed using type representations. Generic functions programmed this way possess certain parametricity properties, which become interesting in the presence of higher-order polymorphism. In this Theoretical ...
متن کاملIs Driving Safe with Upper Limb Plaster Casts? Üst Ekstremite Alçıları ile Sürüş Güvenli midir?
Objective: The purpose of this study is to investigate the ability and safety of driving with commonly used upper limb casts, and to determine the effect of hand dominance. Material and Methods: Two healthy drivers, one of them right-handed and the other left-handed (confirmed with the Edinburgh handedness inventory), were selected. The vehicles used in this study were the 2006 model Volkswagen...
متن کاملCast-bracing for fractures of the femoral shaft. A biomechanical and clinical study.
A study was made of the mechanics of blood-bearing in a series of patients treated with a cast-brace for fracture of the distal femur. Knee hinges incorporating strain-gauges, a simple force-plate on the floor and a standardised weight-bearing test were used to record axial loads through the cast-brace itself and through the fracture during the phases of healing. The cast-brace carried loads of...
متن کاملConversion to below-elbow cast after 3 weeks is safe for diaphyseal both-bone forearm fractures in children
BACKGROUND It is unclear whether it is safe to convert above-elbow cast (AEC) to below-elbow cast (BEC) in a child who has sustained a displaced diaphyseal both-bone forearm fracture that is stable after reduction. In this multicenter study, we wanted to answer the question: does early conversion to BEC cause similar forearm rotation to that after treatment with AEC alone? CHILDREN AND METHOD...
متن کاملEffect of Stone Cast Type on Complete Denture Base Adaptation
Introduction: Few researches have been conducted researches on the influence of the type of dental stone used for fabrication of casts on the adaptation of denture bases. The purpose of this study was to compare the effect of two types of stone casts on the accuracy of fit in complete denture bases. Methods: Using sixty fully replicated master casts obtained by duplicating a metal die represent...
متن کاملCold-forceps avulsion with adjuvant snare-tip soft coagulation (CAST) is an effective and safe strategy for the management of non-lifting large laterally spreading colonic lesions.
BACKGROUND AND AIMS Non-lifting large laterally spreading colorectal lesions (LSLs) are challenging to resect endoscopically and often necessitate surgery. A safe, simple technique to treat non-lifting LSLs endoscopically with robust long-term outcomes has not been described. METHODS In this single-center prospective observational study of consecutive patients referred for endoscopic mucosa...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- J. Funct. Program.
دوره 14 شماره
صفحات -
تاریخ انتشار 2004